<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    main{
      overflow: hidden;
      width: 98%;
    }
    main div.row div.my_body div.panel{
      height: 100%;
    }

    aside.my_nav{
      background-color: #ffffff;
      position: absolute;
      top: 170px;
      left: 20px;
      width: calc(100% / 6 - 40px);
    }
    div.my_body div.panel div.panel-body{
      height: calc(100% - 38px);
      overflow-y: auto;

    }
    .panel{
    }
  </style>
</head>
<div class="bbyy">
  <% include head.ejs %>
  <aside class="panel panel-primary my_nav">
    <div class="panel-heading">
      <h3 class="panel-title">我的</h3>
    </div>
    <div class="panel-body">
      <ul class="list-unstyled" style="line-height: 40px;">
        <li>
          <a href="/users/ge" >我的账户</a>
        </li>
        <li>
          <a href="/users/gtwo"  >完善个人信息</a>
        </li>
      </ul>
    </div>
  </aside>
  <main class="container-fluid">
    <div class="row">
      <div class="col-md-10 col-md-offset-2 my_body">
        <div class="panel panel-primary" id=one style=" display: block;">
          <div class="panel-heading">
            <h3 class="panel-title">完善个人信息</h3>
          </div>
          <div class="panel-body">
            <div id="list">

            </div>
            <form id="form1">
              <lable>电话 ：<input name="phone" id="phone"  style="margin-top: 20px"/></lable><br/>
              <lable>地址 ：<input name="where" id="where"  style="margin-top: 20px"/></lable><br/>
              <lable>个人简介：<input name="speek" id="speek"  style="margin-top: 20px"/></lable><br/>
              <button style="margin-top: 20px">重置</button>
              <button class="btn-primary" id="bb" type="submit">保存</button>
            </form>
          </div>
        </div>
      </div>
    </div>
  </main>
  <% include foot.ejs %>
</div>
<template id="con_temp">
  <p>昵称：{username}</p>
</template>

<script>
  
      function show() {
        $.getJSON('/users/geen', function (obj) {
          let temp = $('#con_temp').html();
          let html = '';
          console.log(obj)
          obj.qq.forEach(function (el) {
            html += temp.replace('{username}', el.username)
          })
          console.log(obj)
          $('#list').html(html);
          console.log(obj)
        })
      }
    show();

</script>
<script>
  $('#bb').click(function () {
    $.post('/users/xiugai', $('#form1').serialize(), function (flag) {
      console.log(flag);
      switch (flag) {
        case 1:
          alert('注册成功');
          break;}
    },'json')
  })
</script>
</html>
